import requestMethod from './formData'
export default function getXML(type,url,parm = '') {
    var request = new XMLHttpRequest();
    request.open(type, url, false)
    request.setRequestHeader("X-Requested-With", "XMLHttpRequest"); //请求头部，需要服务端同时设置
    request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    request.withCredentials = true;
    // request.send()
    request.send(requestMethod(parm));
    if (request.status === 200) {
        return JSON.parse(request.response)
    }
}
